<?php
class Model_DbTable_Questions extends General_Db_Table
{
public function load($id)
	{
		$cond = array('id' => (int)$id);
		$result = $this->select(array(), $cond);
		if($result){
			$result = $result[0];
		}
		return $result;
	}
	public function getQuestionsByTestId($testid)
	{
		$sql = "SELECT * FROM `questions` WHERE `testId` = $testid ";
		$result = $this->conn->query($sql);
		
		if($result){
			while ($row = $result->fetch_object()) {
				$rows[] = $row;
			}
			$result->close();
		}
		return $rows;
	}
}